import { CEWelfareSignIn } from "../excel_extend/CEWelfareSignIn";
import { Player } from "../struct/Player";
import { SDDrop } from "./SDDrop";

/**
 * 数据-福利-签到
 */
export abstract class SDWelfareSign {



    /**
     * 获取周指定天的奖励
     * @param player 
     * @param day 
     * @param week 
     */
    public static getClientDrop(player: Player, day?: number, week?: number): SDDrop {
        const sign = player.welfare.signIn;
        if (!day && day !== 0) {
            day = sign.signDay % 7;
        }
        if (!week && week !== 0) {
            week = Math.floor(sign.signDay / 7);
        }

        const signConfig = CEWelfareSignIn.getConfig(week, day);
        const drop = SDDrop.create().addPossibleDrop(player, signConfig ? signConfig.reward : 0);

        return drop;
    }



}
